package com.qna.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import java.security.Principal;

@Controller
public class LoggedInController {
	
	@RequestMapping("/loggedin")
	public String LoggedInController(ModelMap model, Principal principal) {

		
	      String name = principal.getName(); //get logged in username
	      model.addAttribute("username", name);
		return "loggedin";
	}
}